package com.amado.easyui2.service.impl;

import java.util.List;

import com.amado.easyui2.dao.DrivingSchoolDao;
import com.amado.easyui2.dao.impl.DrivingSchoolDaoImpl;
import com.amado.easyui2.domain.CoachStaffEntity;
import com.amado.easyui2.domain.DrivingSchoolEntity;
import com.amado.easyui2.service.DrivingSchoolService;
import com.amado.easyui2.vo.Page;
import com.mysql.fabric.xmlrpc.base.Array;

public class DrivingSchoolServiceImpl implements DrivingSchoolService {
private DrivingSchoolDao drivingSchoolDao=new DrivingSchoolDaoImpl();
	@Override
	public void add(DrivingSchoolEntity cn) {
		drivingSchoolDao.add(cn);
		
	}

	@Override
	public List<DrivingSchoolEntity> list() {
		// TODO Auto-generated method stub
		return drivingSchoolDao.listAll();
	}

//	@Override
//	public void delete(Long id) {
//		drivingSchoolDao.delete(id);
//		
//	}

	@Override
	public void update(DrivingSchoolEntity cn) {
		drivingSchoolDao.update(cn);
		
	}

	@Override
	public List<DrivingSchoolEntity> list(String cn, String bln) {
		// TODO Auto-generated method stub
		return drivingSchoolDao.listAll(cn, bln);
	}

	@Override
	public List<DrivingSchoolEntity> getCoach(DrivingSchoolEntity bln) {
		// TODO Auto-generated method stub
		return drivingSchoolDao.login(bln);
	}

	@Override
	public Page<DrivingSchoolEntity> listAll(String cn, String bln, Page page) {
		int total = drivingSchoolDao.listAllCount(cn, bln);
		Page<DrivingSchoolEntity> newPage  = new Page<>();
		newPage.setTotal(total);
		newPage.setRows(drivingSchoolDao.listAll(cn, bln, page));
		return newPage;
		
	}

	@Override
	public void delete(List<Long> id) {
		drivingSchoolDao.delete( id);
		
	}

	
}
